Merged
Conversation
…uter
This commit implements `opentelemetry` instrumentation for the `decode` and `sendEncoded` calls in `wrapRouter`.
Changes:
- `typed-express-wrapper`
- `@opentelemetry/api@^1.0.0` added as an optional peer dependency
- `@opentelemetry/sdk-trace-base@1.30.1` , `@opentelemetry/sdk-trace-node@1.30.1`, and `@opentelemetry/api@1.9.0` added as dev dependencies
- `wrapRouter` modified to create decode and encode spans if `@opentelemetry/api` is installed
- if `@opentelemetry/api` is not installed, spans are not created
- `onDecodeError` option removed. Please use `decodeErrorFormatter` and `getDecodeErrorStatusCode`
- `decodeErrorFormatter` takes in an array of `ValidationError`s and a `WrappedRequest`, returning a `Json` object.
- `getDecodeErrorStatusCode` takes in an array of `ValidationError`s and a `WrappedRequest`, returning a number.
- `onEncodeError` option removed. Please use `encodeErrorFormatter` and `getEncodeErrorStatusCode`
- `encodeErrorFormatter` takes in an error and a `WrappedRequest`, returning a `Json` object.
- `getEncodeErrorStatusCode` takes in an error and a `WrappedRequest`, returning a number.
- `typed-express-router` now handles the sending of the http response when there is a decode or encode error
- `express-wrapper`
- `routerForApiSpec` modified to pass in new parameters `decodeErrorFormatter`, `getDecodeErrorStatusCode`, `encodeErrorFormatter`, and `getEncodeErrorStatusCode`
- These new parameters can also be customized by modifying the props passed into the function (see `CreateRouterProps`)
BREAKING CHANGE: `onDecodeError` and `onEncodeError` have been removed. Please use `decodeErrorFormatter`, `getDecodeErrorStatusCode`, `encodeErrorFormatter`, and `getEncodeErrorStatusCode`
…yped-express-router feat(opentelemetry): create otel instrumentation for typed-express-router
docs: update README.md with information regarding new error formatters
ericcrosson-bitgo
approved these changes
Aug 1, 2025
Contributor
ericcrosson-bitgo
left a comment
There was a problem hiding this comment.
Merges beta into master. Thanks @starfy84!
shenbenson
approved these changes
Aug 1, 2025
|
🎉 This PR is included in version @api-ts/typed-express-router@2.0.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/express-wrapper@2.0.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @api-ts/openapi-generator@5.10.2 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: DX-1642
This PR merges beta changes into the master branch, publishing the beta packages to the latest version